cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
cmake_policy(VERSION 3.8)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

set(NAME MediapipeHandTracking)

project(${NAME})

set(OpenCV_DIR "/usr/local/opt/opencv@3")
find_package(OpenCV REQUIRED)
IF(OpenCV_FOUND)
    message(STATUS "OpenCV headers found at " ${OpenCV_INCLUDES})
    message(STATUS "OpenCV library found at " ${OpenCV_LIBRARIES})
ELSE(OpenCV_FOUND)
    message(STATUS "OpenCV library not found!")
ENDIF()

set(SOURCE  src/main.cpp)

if(WIN32)
    add_executable(${NAME} ${SOURCE})
    target_include_directories(${NAME} PUBLIC ${OpenCV_INCLUDES} ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR})
    target_link_libraries(${NAME} ${OpenCV_LIBRARIES} ${CMAKE_SOURCE_DIR}/lib/MediapipeHandTracking.dll)
else(WIN32)
    add_executable(${NAME} ${SOURCE})
    target_include_directories(${NAME} PUBLIC ${OpenCV_INCLUDES} ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR})
    target_link_libraries(${NAME} ${OpenCV_LIBRARIES} ${CMAKE_SOURCE_DIR}/lib/libMediapipeHandTracking.so)
endif(WIN32)